FROM python:3.11-slim-bullseye

WORKDIR /app

RUN pip install poetry

RUN apt-get update && apt-get install -y binutils wkhtmltopdf
RUN strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5

COPY pyproject.toml poetry.lock ./

RUN poetry install

COPY src ./src

ENV PYTHONPATH=/app/src

CMD ["poetry", "run", "python", "src/main.py"]
